package com.quanquan.store.repository;

import com.quanquan.store.entity.ActivityApply;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * 功能描述:
 *
 * @ClassName: ActivityApplyRepository
 * @Author: xiaoqianh丶
 * @Date: 2019-06-27 13:52
 * @Version: V1.0
 */
public interface ActivityApplyRepository  extends JpaRepository<ActivityApply,String>, JpaSpecificationExecutor<ActivityApply> {

    /**
     * 根据活动id和用户id查询信息
     * @param activityId
     * @param userId
     * @param num
     * @return
     */
    public ActivityApply findByActivityIdAndUserIdAndRemove(String activityId, String userId, Integer num);


    /**
     * 查询报名记录
     * @param activityId
     * @return
     */
    List<ActivityApply> findByActivityId(String activityId);


    /**
     * 根据活动id和用户id查询信息
     * @param activityId
     * @param userId
     * @return
     */
    public ActivityApply findByActivityIdAndUserId(String activityId, String userId);


    /**
     * gen'ju
     * @param userId
     * @param num
     * @return
     */
    public List<ActivityApply> findByUserIdAndRemove(String userId, Integer num);
}
